﻿@* Please keep in mind that this layout view is also referenced and used by modules! *@

@{
    Layout = "_AdminRoot";
}

@if (ViewBag.RefreshPage == true)
{
    <script>
		try {
			window.parent.document.forms['@(ViewBag.formId)'].@(ViewBag.btnId).click();
		}
		catch (e) {
			try { window.parent.document.getElementById('@(ViewBag.btnId)').click(); }
			catch (e2) { }
		}

		@if (!(ViewBag.CloseWindow == false))
		{
			<text>window.parent.closePopup();</text>
		}
    </script>
}

<div id="page">
    <div class="page-main">
        <header id="header">
            <zone name="header" replace-content="true">
                <zone name="admin_navbar_before"></zone>
                @await Component.InvokeAsync("AdminNavbar")
                <zone name="admin_navbar_after"></zone>
            </zone>

            <div id="breadcrumb">
                <zone name="admin_breadcrumb"></zone>
            </div>
        </header>

        <aside sm-suppress-if-empty-zone="sidebar_left" class="sidebar-left custom-scrollbar">
            @{ 
                Assets.BodyAttributes.AppendCssClass("has-left-sidebar");
            }
            <zone name="sidebar_left"></zone>
        </aside>

        <zone name="beforemaincontent"></zone>

        <div id="content">
            <div class="cph">
                <zone name="admin_content_before"></zone>
                @RenderBody()
            </div>
            <div id="ajax-busy">
                <div class="bar"></div>
                <div class="bar"></div>
                <div class="bar"></div>
            </div>
        </div>

        <zone name="aftermaincontent"></zone>
    </div>

    <zone name="admin_content_after"></zone>
</div>

<partial name="Notifications" />